<?php
/**
 * @file 3gplex/includes/exception.inc
 * 
 * 
 */

class plex_exception extends Exception
{
	protected $arguments = null;

	function __construct($message, $arguments = null)
	{
		$this->message = $message;
		$this->arguments = $arguments;
	}

	function display()
	{
		plex::warn($this->message." [[".$this->getFile().":".$this->getLine()."]]", $this->arguments);
	}
}

class plex_debug_exception extends plex_exception
{
	function __construct($message = null, array $arguments = null)
	{
		if (!is_null($message)) $this->message = $message;
		else $this->message = "Debug Exception:";

		$this->arguments = $arguments;
	}

	function display()
	{
		plex::warn("<pre>{$this->getTraceAsString()}<pre><p>{$this->message}<br/>In {$this->getFile()}:{$this->getLine()}</p>", $this->arguments);
	}
}
